<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.1.2/echarts.min.js"></script>
</head>

<body>
  <!-- 定义一个宽高的DOM -->
  <div id="main" style="width: 600px; height: 400px"></div>
  <script type="text/javascript">
    // 初始化ECharts实例
    const myChart = echarts.init(document.getElementById('main'))

    // 指定图表的配置项和数据
    const option = {
      title: {
        text: '可视化图表展示'
      },
      tooltip: {},  //提示框控件
      legend: {     //图例控件
        data: ['销量']
      },
      xAxis: {
        data: ['雷克萨斯', '猛禽F-15', '皇冠', '亚洲狮', '亚洲龙']
      },
      yAxis: {},
      series: [  //多系列配置
        {
          // name: '销量',
          type: 'bar',  //柱状图
          data: [5, 20, 36, 10, 10, 20]
        },
        {
          type: 'line', //折线图
          data: [5, 20, 36, 10, 10, 20]
        }      
      ],
      series: [
        {
          name: '销量',
          type: 'line', //折线图
          data: [5, 20, 36, 10, 10, 20]
        }
      ]
      
    };

    // 使用刚指定的配置项和数据显示图表
    myChart.setOption(option)
  </script>
</body>

</html>